package com.ganzi.ganziserver.rabbit.send;

import com.ganzi.ganziserver.service.SendService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/***
 * 查询学校状态和采集器线程，只在服务启动查询一次
 *
 * */
@Component
public class QuerySchoolState implements CommandLineRunner {

    private static Logger log = LoggerFactory.getLogger(QuerySchoolState.class);
    @Autowired
    SendService service;


    @Override
    public void run(String... args) throws Exception {
        log.info("查询学校状态以及采集器");
        service.sendStateMessageByQueue();
    }
}
